import { readFile, writeFile } from 'fs/promises'
export async function fileToBase64(filePath) {
  const buffer = await readFile(filePath)
  return buffer.toString('base64')
}
export async function base64ToFile(base64Str, outputPath) {
  const buffer = Buffer.from(base64Str, 'base64')
  await writeFile(outputPath, buffer)
}